import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '@/views/Login.vue'

import Reg from '@/views/Reg.vue'

import Layout from '@/views/Layout/index.vue'
import Home from '@/views/Layout/components/Home'
import ArtCategory from '@/views/Layout/components/ArtCategory'
import ArtList from '@/views/Layout/components/ArtList'
import UserInfo from '@/views/Layout/components/UserInfo'
import ChangeAvatar from '@/views/Layout/components/ChangeAvatar'
import ResetPwd from '@/views/Layout/components/ResetPwd'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [{
    path: '/login',
    component: Login
  }, {
    path: '/reg',
    component: Reg
  }, {
    path: '/',
    redirect: '/home',
    component: Layout,
    children: [{ path: '/home', component: Home },
      { path: '/artcategory', component: ArtCategory },
      { path: '/artlist', component: ArtList },
      { path: '/userinfo', component: UserInfo },
      { path: '/changeavatar', component: ChangeAvatar },
      { path: '/resetpwd', component: ResetPwd }]
  }]
})

export default router
